
from mcp.server.fastmcp import FastMCP

#实例mcp
mcp = FastMCP("Weather MCP Server")


#创建浆糊
@mcp.resource(
    uri="file:///query/book.txt",
    name="book",
    description="查询书籍信息",
    mime_type="text/plain",
)
def query_book():
    """
     读取本地文件books.txt
     """
    with open("books.txt", "r",encoding="utf-8") as f:
        content = f.read()
        return content


if __name__ == "__main__":
    print(" MCP Server 启动中...")
    mcp.run(transport="sse")
